﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using ZhiHeng.Consume.DataContract;

namespace ZhiHeng.OneCard.WpfClient.Common
{
    public class StaticDicdictionary
    {
        /// <summary>
        /// 字典类型
        /// </summary>
        public enum TypeDicdictionary
        {
            /// <summary>
            /// 商品
            /// </summary>
            [Description("商品")]
            商品 = 1,
            /// <summary>
            /// 商户类型
            /// </summary>
            [Description("商户类型")]
            商户类型 = 2,
            /// <summary>
            /// 状态
            /// </summary>
            [Description("状态")]
            状态 = 3,
            /// <summary>
            /// 角色类型
            /// </summary>
            [Description("状态")]
            角色类型 = 4,
            ///// <summary>
            ///// 门票类型
            ///// </summary>
            //[Description("门票类型")]
            //门票类型 =6,
            // /// <summary>
            ///// 门票价格
            ///// </summary>
            //[Description("门票价格")]
            //门票价格 = 7
        }

        private static IEnumerable<ConfigTreeInfo> _treeDicdictionary;
        /// <summary>
        /// 字典表数据
        /// </summary>
        public static IEnumerable<ConfigTreeInfo> TreeDicdictionary
        {
            get
            {
                if (_treeDicdictionary == null)
                    ReadConfigTreeInfo();
                return _treeDicdictionary;
            }
            set { _treeDicdictionary = value; }
        }


        private static Dictionary<bool, string> _tollType;
        public static Dictionary<bool, string> TollType
        {
            get
            {
                if (_tollType == null)
                {
                    _tollType = new Dictionary<bool, string>();
                    _tollType.Add(true, "时间");
                    _tollType.Add(false, "次");
                }
                return _tollType;
            }

        }
          
        /// <summary>
        /// 重新加载字典表数据
        /// </summary>
        public static void ReadConfigTreeInfo()
        {
            TreeDicdictionary = new ConfigTreeInfo().ExtGetAll();
        }
    }
}
